package com.lmb.todo.controller;

import com.lmb.todo.pojo.Group;
import com.lmb.todo.service.GroupService;
import com.lmb.todo.utils.DateUtil;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class testGroupService {

    @Autowired
    private GroupService groupService;

    @Test
    public void testUpdate(){
        Group gr = new Group();
        gr.setId(1);
        gr.setGname("aaaaa");
        gr.setCount(11);
        Integer count = groupService.update(gr);
        System.out.println(count);
    }

    @Test
    public void  testDelete(){
        Integer count = groupService.delete(20);
        System.out.println(count);
    }

    @Test
    public void testMove() throws Exception{
        Integer count = groupService.move(3,20);
        System.out.println(count);
    }

    @Test
    public void testadd(){
        String createTime = DateUtil.getCurrentDateStr();
        Group group = new Group(1, 1, "aa1", "新计划", "今天要干的事情", createTime, null, 0);
        Integer count = groupService.add(group);
        System.out.println(count);
    }
}
